<!DOCTYPE html>
<html lang="en" ng-app="huabote" >
<head>
    <meta charset="UTF-8">
    <title>华博特教育平台-登录页</title>
    <link rel="styleSheet" type="" href="frameWork/bootstrap.min.css">
    <link rel="stylesheet" href="css/directive.css">
    <style>
        html{
            height:100%;
        }
        body{
            width:100%;
            height:100%;
            background:url("images/loginBg.jpg") no-repeat;
            background-size:cover;
            /*background-position:center;
            background-attachment: fixed;*/
        }
        .loginContainer{
            width:1200px;
            margin:0 auto;
            padding-top:200px;
        }
        .loginBox{
            width:440px;
            height:360px;
            padding:0;
        }
        .loginBox .panel-heading{
            text-align:center;
            border-bottom:1px solid #e5e5e5;
            line-height:40px;
            font-size:24px;
            color:#159BD5;
            font-weight:bold;
        }
        .loginBox  .panel-body{
            padding:30px 55px;;
        }
        .form-group{
            margin-bottom:0;
        }
        .form-group p{
            line-height:25px;
            height:25px;
            color:#f00;
            padding-left:5px;
        }
        input[type='text'],input[type="password"]{
            border:none;
            outline:none;
            box-shadow:none;
            border-bottom:1px solid #666;
            border-radius:0;
            padding:10px 40px;
        }
         input[type='text']:focus,input[type="password"]:focus{
             border-color:#666;
             box-shadow:none;
         }
         input[type='text']{
             background:url("images/user3.png") no-repeat 5px 6px;
             padding-left:40px;
         }
         input[type='password']{
             background:url("images/password.png") no-repeat 5px 6px;
             padding-left:40px;
         }
         input[type="checkbox"]{
             position:relative;
             top:3px;
             margin:0 5px;
         }
         label{
             font-weight:normal;
             margin-top:5px;
             margin-bottom:15px;
         }
         .btn{
             font-size:18px ;
         }
          .alert{
             display:none;
         }
         
        
    </style>
    <script>
  var userAgent = navigator.userAgent,   
rMsie = /(msie\s|trident.*rv:)([\w.]+)/,   
rFirefox = /(firefox)\/([\w.]+)/,   
rOpera = /(opera).+version\/([\w.]+)/,   
rChrome = /(chrome)\/([\w.]+)/,   
rSafari = /version\/([\w.]+).*(safari)/;  
var browser;  
var version;  
var ua = userAgent.toLowerCase();  
function uaMatch(ua){  
  var match = rMsie.exec(ua);  
  if(match != null){  
    return { browser : "IE", version : match[2] || "0" };  
  }  
  var match = rFirefox.exec(ua);  
  if (match != null) {  
    return { browser : match[1] || "", version : match[2] || "0" };  
  }  
  var match = rOpera.exec(ua);  
  if (match != null) {  
    return { browser : match[1] || "", version : match[2] || "0" };  
  }  
  var match = rChrome.exec(ua);  
  if (match != null) {  
    return { browser : match[1] || "", version : match[2] || "0" };  
  }  
  var match = rSafari.exec(ua);  
  if (match != null) {  
    return { browser : match[2] || "", version : match[1] || "0" };  
  }  
  if (match != null) {  
    return { browser : "", version : "0" };  
  }  
}  
var browserMatch = uaMatch(userAgent.toLowerCase());  
if (browserMatch.browser){  
  browser = browserMatch.browser;  
  version = browserMatch.version;  
}  
 if(browser=="IE"&&parseInt(version)<11){
     window.location.href="error.html"
 } 
        // if(navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.match(/6./i)=="6."){ 
            
        // alert("IE 6"); 
        // } 
        // else if(navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.match(/7./i)=="7."){ 
        // alert("IE 7"); 
        // } 
        // else if(navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.match(/8./i)=="8."){ 
        // alert("IE 8"); 
        // } 
        // else if(navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.match(/9./i)=="9."){ 
        // alert("IE 9"); 
        // }
    </script>
</head>
<body id="login" ng-controller="login">
    <div class="alert alert-warning">
        系统检测出您当前使用的浏览器内核不是chrome内核，为了更佳的学习效果，请使用<a href=''>chrome浏览器</a>或者<a href=''>360浏览器极速模式</a>！
    </div>
    <div>
        <img src="images/1911.png" alt="">
    </div>
    <div class="loginContainer">
        <div class="loginBox panel pull-right">
            <div class="panel-heading">
                登录平台
            </div>
            <div class="panel-body">
                <form name="login"  novalidate ng-submit="loginValidate()">
                    <div class="form-group">
                        <input type="text" name="userCode" ng-model="formData.userCode" value="" class="form-control" required>
                        <p>
                            <small ng-cloak ng-if="login.$submitted&&login.userCode.$error.required" >
                                用户名不能为空！
                            </small>
                        </p>
                    </div>
                    <div class="form-group">
                        <input type="password" name="passWd" ng-model="formData.passWd" value="" class="form-control" required>
                        <p >
                            <small ng-cloak ng-if="login.$submitted&&login.passWd.$error.required" >
                                密码不能为空
                            </small>
                        </p>
                    </div>
                    <div class="form-group">
                        <label><input type="checkbox" > 记住密码</label>
                    </div>
                    <div class="form-group">
                        <button type="submit" class="btn btn-block" style="background:#0288D1;color:#fff">登录</button>
                    </div>
                </form>    
            </div>
        </div>
    </div>
    <script src="frameWork/angular.min.js"></script>
    <script src="frameWork/jquery-3.1.0.js"></script>
    <script src="frameWork/jquery.form.js"></script>
    <!--<script src="frameWork/angular-ui-router-0.4.2.js"></script>
    <script src="frameWork/angular-cookies.min.js"></script>
    <script src="frameWork/ui-bootstrap-tpls-1.3.0.min.js"></script>
    <script src="js/app.js"></script>
    <script src="js/controller.js"></script>
    <script src="js/directive.js"></script>
    <script src="js/service.js"></script>-->
    <script>
    getBrowserInfo=function(){
        var agent = navigator.userAgent.toLowerCase() ;
        var regStr_chrome = /chrome\/[\d.]+/gi ;
        console.log(agent.indexOf("chrome"));
        //判断是否是chrome内核
        if(agent.indexOf("chrome")<0){
            
            str=""
            var element=document.getElementsByClassName('alert')[0];
            element.innerHTML=str;
            element.style.display="block";
            // console.log(document.getElementsByClassName('alert')); 
        }
    } 
    getBrowserInfo(); 
        angular.module("huabote",[])
        .controller("login",['$scope','$window','$http',function($scope,$window,$http){  
                 
            $scope.formData={};
            $scope.loginValidate=function(){
                if($scope.login.userCode.$error.required||$scope.login.passWd.$error.required){
                    return;
                }else{
                    var data=angular.toJson($scope.formData);
                    console.log(data);
                    $("form").ajaxSubmit({
                        type: "post",
                        dataType: "json",
                        url:"http://test.huabote.com.cn/Index/login",
                        success:function(data){
                           if(data.code==0){
                               alert(data.msg);
                               $window.location.href="main.html"
                           }else if(data.code==1){
                                alert(data.msg);
                           }
                        }
                    })
                }  
            }
        }])
    </script>
</body>
</html>